package com.dfbz.demo;

/**
 * @author lscl
 * @version 1.0
 * @intro:
 */
public class Demo03_字符串的获取方法 {

    public static void main(String[] args) {

        String s1="hello";

        int length = s1.length();
        System.out.println(length);            // 5
        System.out.println("---------------");

        String newStr = s1.concat("world");
        System.out.println(newStr);
        System.out.println("---------------");

        char c1 = s1.charAt(0);
        System.out.println(c1);         // h
        char c2 = s1.charAt(1);
        System.out.println(c2);         // e
        System.out.println("---------------");

        int index = s1.indexOf("l");
        System.out.println(index);


    }
}
